/**
 * Created with JetBrains WebStorm.
 * User: Eric
 * Date: 20/03/13
 * Time: 14:00
 * To change this template use File | Settings | File Templates.
 */
var tileDao = require("../model/TileDao");
var Tile = require("../model/Tile");
exports.generateMap = function(req, res){

 /*   var ts = new Array();
    var dimentions = {width : 50, height : 50};
    var radius = 2000;
    var center = {x : 0, y: 0};

    for(var x = center.x - radius; x < center.x + radius; x += dimentions.width){
        for(var y = center.y - radius; y < center.y + radius; y += dimentions.height){
            var t = new Tile();
            t.width = dimentions.width;
            t.height = dimentions.height;
            t.coordinateX = x;
            t.coordinateY = y;
            t.health = null;
            t.personage = null;
            ts.push(t);
        }
    }*/

    //console.log(ts);

    tileDao.addAll(ts,function () {
         res.redirect("/login");
    });
};